﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using PromotionApp.DAL;

namespace PromotionApp.BLL
{
    public class DomainBLL
    {
        #region Private Variable

        private static DomainBLL _DomainBLL = null;

        #endregion 

        #region Constructor

        private DomainBLL()
        {            
        }

        #endregion

        #region Public Method

        public List<string> GetAllDomain()
        {
            List<string> list = new List<string>();
            DataSet ds = DomainDAL.GetInstance().GetAllDomain();

            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)            
                foreach (DataRow r in ds.Tables[0].Rows)                                    
                    list.Add(r["DomainName"].ToString().Trim());                            
            
            return list;
        }

        public static DomainBLL GetInstance()
        {
            if (_DomainBLL == null)
                _DomainBLL = new DomainBLL();

            return _DomainBLL;
        }


        #endregion
    }
}